fixed out of boundaries and others