Added checks to prevent crashing maven