added some checks to avoid fails. thanks to an user :)