fixed problem with multiple returns