Fix error reports 204/711/1285: Cannot read property 'top' of undefined

Signed-off-by: Atul Pratap Singh <atulpratapsingh05@gmail.com>