fixed bug which caused sprite object to be invisible in some cases.