Made the code reliable for android clients.