updated with fixes ,thanks to MikoDev