cleaned up raven fix into single funciton