handling undefined
typo
handling null casee
added pixel load api